package com.jsoft.jsofted.sys.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.diboot.core.binding.annotation.BindField;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.IsNotNull;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.jsoft.jsofted.framework.entity.OfTenantEntity;
import com.jsoft.jsofted.framework.entity.TreeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 职位信息表
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Table("sys_post")
@TableName("sys_post")
public class PostEntity extends OfTenantEntity implements TreeEntity {

    @Column(length = 64)
    @IsNotNull
    protected String name;

    @Column
    protected Long parentId;

    @TableField(exist = false)
    @BindField(entity = PostEntity.class, field = "name", condition = "parent_id=id")
    protected String parentName;

    @Column(length = 20, decimalLength = 6)
    @IsNotNull
    protected BigDecimal sortValue;

}
